#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>

//P736
int main()
{
	printf("Input a number with 4-digit:");
	int num = 0;
	scanf("%d", &num);
	int ge = num % 10;
	int shi = (num /10) % 10;
	int bai = (num /100) % 10;
	int qian = num / 1000;
	int sum = ge + shi + bai + qian;
	printf("\nsum = %d\n", sum);
	return 0;
}